package com.persistence;

import com.models.User;
import org.junit.Test;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by TimeLiar on 2015/9/22.
 *
 */
public class UserPersistenceTest {

    @Test
    public void testInitUserSet() throws Exception {
        UserPersistence.initUserSet();
    }

    @Test
    public void testPersistence() throws Exception {
        User user = new User();
        user.setPassword("aa");
        user.setUsername("ad");
        Map<String,String> permission = new HashMap<>();
        permission.put("table","*");
        permission.put("aa","*");
        user.setPermission(permission);
        UserPersistence.getUsers().add(user);

        UserPersistence.persistence();
        System.out.println(UserPersistence.getUsers());
    }
}